<?php
require_once 'controller.php';
if($params->c != '') {
	$course = $instructor->getCourse($params->c);
	$groups = $course->getAllGroups();
} else {
	redirect('myetat.php');
}

if(isset($_POST['add_group_submit'])) {
	unset($_SESSION['add_project']);
	$_SESSION['add_project']->course = $course->id;
	$_SESSION['add_project']->step = 0;
	redirect('addgroup.php');
}


?><?php
 
if(isset($groups)) {
	foreach($groups as $g) {
		print "<div id='$g->id-details'>";
		print "<a href='groupdetail.php?g=$g->id'>$g->name</a><ul class='indent'>";
//		print "<li>SVN Commits: {$g->getSVNCount()}</li>
//			<li>Wiki Updates: {$g->getWikiCount()}</li>
//			<li>Forum Posts: {$g->getForumCount()}</li>
//			<li>Files: {$g->getFileCount()}</li>
//			<li>Issue Tracker Updates: {$g->getIssueCount()}</li>";
		print '</ul></div>';
	}
} else {
?>
<div id='update-msg'><p>Looks like you haven't added any groups for monitoring, yet.Let's get started by pressing the <b>Add Group</b> button below:</p>
</div>

<?php 
}
?>